<?php
$compchecked = '';
 $trainerResponse = MakeQuery::trainerResponseRate($model->users_id, $model->backend_user_id);
if (!empty($compareIds)) {
    $display = '';
    if (in_array($model->id . "@class", $compareIds)) {
        $compchecked = 'checked="checked"';
    }
} else {
    $display = 'none';
}
$this->renderPartial('/compare/_view', array('compareIds' => $compareIds, 'classmodel' => $model, 'display' => $display));
?>
<div class="featureBox">
    <div class="container">
        <div class="row">
            <div class="span12">                
                <ul class="breadcrumb">
                    <li class="previous"><a href="<?php echo SITE_URL; ?>">Home</a> /</li>
                    <li><a href="javascript:void(0)"><?php echo $model->class_titile; ?></a></li>
                </ul>                    
            </div>
            <div class="span6">
                <!--Trainer Overview Section-->                
                <div class="featureImg drag-desired">
                    <?php
                    if (ClassImage::getPrimaryImage($model->id) <> "") {
                        echo '<div class="product"><img src="' . baseUrl() . '../../' . SkillConfig::getClassCourseImagePath($imagePath) . 'details-image/' . ClassImage::getPrimaryImage($model->id) . '"  alt="' . $model->class_titile . '" id="' . $model->id . '"></div>';
                    } else {
                        echo '<div class="product"><img src="' . baseUrl() . '../../' . getUploadDir() . '/no-class-image.jpg" height="335" width="460"  alt="' . $model->class_titile . '" id="' . $model->id . '"></div>';
                    }
                    if ($model->class_type_id == CURATED_CLASS_TYPE) {
                        ?>
                        <div class="offTag">
                            <p class="font-opensansbd txtUpCase txtfff remmarginB"><?php echo $discount; ?> </p>
                        </div>  
                    <?php } ?>
                    <div class="description">
                        <div class="col col1">    
                            <?php                          
                            $this->widget('CStarRating', array(
                                'name' => 'FunLearning[fun]',
                                'value' => ($funLearing != '') ? $funLearing->fun/20 : '',
                                'minRating' => 0.5,
                                'readOnly' => TRUE,
                                'ratingStepSize' => 0.5,
                                'maxRating' => 5,
                            ));
                            ?>                          
                            <!--<i class="star-rating star-5"></i> -->                          
                            <p class="fnt-size12 txtfff remmarginB">Fun Quotient</p>
                        </div>
                        <div class="col col2">
                            <?php
                            $this->widget('CStarRating', array(
                                'name' => 'FunLearning[learn]',
                                'value' => ($funLearing != '') ? $funLearing->learn/20 : '',
                                'minRating' => 0.5,
                                'readOnly' => TRUE,
                                'ratingStepSize' => 0.5,
                                'maxRating' => 5,
                            ));
                            ?>
                                                        <!--<i class="star-rating star-4"></i>-->
                            <p class="fnt-size12 txtfff remmarginB">Learn Quotient</p>
                        </div>
                        <div class="col col3">
                            <p class="txtgreen font-opensansbd remmarginB"><?php echo (!empty($trainerResponse) ? $trainerResponse . '%' : TRAINER_RESPONSE_RATE); ?></p>
                            <p class="fnt-size12 txtfff remmarginB">Response Rate</p>
                        </div>
                        <div class="col col4">
                            <p class="txtgreen font-opensansbd remmarginB"><?php echo ($model->difficulty_type == '1' ? 'Beginner' : ($model->difficulty_type == '2' ? 'Intermediate' : ($model->difficulty_type == '3' ? 'Advance' : 'No data'))); ?></p>
                            <p class="fnt-size12 txtfff remmarginB">Level</p>
                        </div>
                    </div>              
                </div>
                <!--End Trainer Overview Section-->
            </div>
            <div class="span6">
                <!--Trainer Detail Section-->
                <div class="detailBox detailBoxLink">
                    <p class="font-opensansbd fnt-size12">By <span class="txtgreen"><?php echo $userDetails->first_name . '  ' . $userDetails->last_name; ?></span></p>
                    <h4 class="txt676 fnt-size20 addpaddingB10"><?php echo $model->class_titile; ?></h4>
                    <div class="height1px borBgren addmarginB10"></div>
                    <p class="fnt-size18">
                        <?php echo $priceRange; ?>
                    </p>
                    <div class="height1px borBgren addmarginB10"></div>
                    <div class="addmarginB10"><input type="checkbox"  <?php echo $compchecked; ?>  id="<?php echo $model->id; ?>" class="comareclass" value="<?php echo $model->id; ?>"><label>Compare Class</label></div>
                    <div class="height1px borBgren addmarginB30"></div>
                    <a href="javascript:void(0);" class="btn-green twoBtn" id="mybook"><?php echo $booknow; ?></a>
                    <?php echo CHtml::link('Recommend to a friend', $this->createAbsoluteUrl('RecommendToUser/create/', array('id' => $model->id,'type'=>'classes')), array('class' => 'btn-blue twoBtn')); ?>
                    <?php echo ($model->class_type_id == CURATED_CLASS_TYPE) ? "<a href='' class='btn-green'>Gift A Class</a>" : ""; ?>
                </div>
                <!--End Trainer Detail Section-->
            </div>
        </div>
    </div>
</div>
<a id="venueBatchscroll"></a>
<section class="contentCntr whiteBg noRadius">
    <div class="container">
        <div class="row">
            <div class="span8">
                <!--Content Area-->
                <div class="descriptionArea">                  
                    <ul class="nav nav-tabs" id="myTab">
                        <li class="active"><a href="#information" data-toggle="tab">Information</a></li>
                        <li><a href="#trainer" data-toggle="tab">Trainer</a></li>
                        <li><a href="#reviews" data-toggle="tab">Reviews</a></li>
                        <li><a href="#pictures" data-toggle="tab">Pictures &amp; Videos</a></li>
                        <li><a href="#venueBatch" id="myvbatch" data-toggle="tab">Venue &amp; Batch Details</a></li>
                    </ul>

                    <div id="descriptionTabs" class="tab-content">
                        <div class="tab-pane active" id="information">
                            <h2 class="remmarginT">Class Description</h2>
                            <?php echo $model->class_description; ?>
                            <h2>Class Outcome</h2>
                            <?php echo $model->class_outcome; ?>
                            <h2>Prerequisities</h2>
                            <?php echo $model->class_prerequisites; ?>

                        </div>

                        <?php /* here is the code of trainer details start */ ?>
                        <div class="tab-pane" id="trainer">
                            <?php /* ---------render page userPage for userDetails all  review start ---------------- */ ?>
                            <?php $this->renderPartial('/users/userDetails', array('userDetails' => $userDetails, 'imagePath' => $imagePath, 'classmodel' => $model, 'userType' => $userType)); ?>
                            <?php /* ---------render page userPage for userDetails end---------------- */ ?>
                        </div>
                        <?php /* here is the code of trainer details start */ ?>

                        <div class="tab-pane" id="reviews">
                            <?php
                            $reviewdetails = Reviews::getAllReview('classes_id', $model->id);
                            if (!empty($reviewdetails)) {
                                foreach ($reviewdetails as $key => $value) {
                                    $profile = Users::getFrontEndUser($value->users_id);
                                    ?>
                                    <div class="padding20px">
                                        <div class="reviewBoxText">
                                            <?php
                                            if ($profile->photo <> "") {
                                                $imgsrc = baseUrl() . '../../' . getUploadDir() . $profile->user_id . '/profile/minithumb/' . $profile->photo;
                                            } else {
                                                $imgsrc = baseUrl() . '../../upload/default-mini.png';
                                            }
                                            ?>
                                            <img src="<?php echo $imgsrc; ?>" title="<?php echo $profile->first_name; ?>" alt="<?php echo $profile->first_name; ?>" />
                                        </div>
                                        <div class="reviewBoxTextcol2"><?php echo $profile->first_name . '   ' . $profile->last_name; ?><br/>
                                            <?php echo $value->reviews_text; ?><br/><br/>
                                            <?php echo $value->create_time; ?></div>
                                    </div>
                                    <div class="clear"></div>
                                    <?php
                                }
                            }
                            ?>
                        </div>

                        <?php /* here is the code of Classses images start */ ?>
                        <div class="tab-pane" id="pictures">
                            <div style="margin: 92px 0px 0px 0px;">                                
                                <?php
                                $classWithImage = Classes::getclassWithImage($model->id);
                                if (!empty($classWithImage)) {
                                    $i = 1;
                                    ?>
                                    <div id="slider-fixed-banner" class="carousel slide">
                                        <div class="carousel-inner"><?php foreach ($classWithImage as $value) { ?>
                                                <div class="<?php echo ($i == 1) ? 'active' : ''; ?> item">
                                                    <?php echo '<img src="' . baseUrl() . '../../' . SkillConfig::getClassCourseImagePath($imagePath) . 'slider-image/' . $value['photo'] . '"  alt="">'; ?>
                                                </div>
                                                <?php
                                                $i++;
                                            }
                                            ?>
                                        </div>
                                        <a class="left carousel-control" href="#slider-fixed-banner" data-slide="prev">&lsaquo;</a>
                                        <a class="right carousel-control" href="#slider-fixed-banner" data-slide="next">&rsaquo;</a>
                                    </div><?php
                                    } else {
                                        echo '<img src="' . baseUrl() . '../../' . getUploadDir() . '/no-class-image.jpg"   alt="class" id="classcourse">';
                                    }
                                        ?>
                            </div>
                        </div>  
                        <?php /* here is the code of Classses images end */ ?>
                        <div class="tab-pane" id="venueBatch">
                            <?php /* ---------render page classBatch for _venueBatchDetails all  review start ---------------- */ ?>
                            <?php $this->renderPartial('/classBatch/_venueBatchDetails', array('model' => $model)); ?>
                            <?php /* ---------render page classBatch for _venueBatchDetails end---------------- */ ?>
                        </div>
                    </div>                              
                </div>    
                <!--End Of Content Area-->    
            </div>
            <div class="span4">                
                <!--Book Now-->
                <div class="bookNowBox radius4px">
                    <!--<div id="AjaxLoaderMakeQ" style="margin: 0 auto;width: 50%;display: none;"><img src="<?php echo ThemePath(); ?>/images/AjaxLoader.gif"></img></div>-->
                    <?php if ($model->class_type_id == CURATED_CLASS_TYPE) { ?>
                        <?php
                        $this->renderPartial('/shoppingCart/_form', array('venueDetails' => $venueDetails, 'classcoursetype' => 'class', 'batchStartDateList' => $batchStartDateList, 'batchStartTimeList' => $batchStartTimeList,
                            'batchseatList' => $batchseatList, 'batchId' => $batchId,));
                        ?>
                    <?php } elseif ($model->class_type_id == LEAD_CLASS_TYPE) {
                        ?>
                        <div class="formElements">
                            <?php /* ---------render page Make Query ---------------- */ ?>
                            <?php $this->renderPartial('/makeQuery/_form', array('type' => 'classes', 'model' => $makeQueryModel, 'timingMakequeryModel' => $timingMakequeryModel, 'classModel' => $model)); ?>
                            <?php /* ---------render page Make Query ---------------- */ ?>
                        </div>
                    <?php } ?>
                </div>
                <!--End of Book Now-->
            </div>    
        </div>
    </div>    
</section>



<section class="contentCntr">
    <div class="container">
        <div class="row">
            <div class="span5">
                <!--Review Box-->
                <div class="reviewBox">  
                    <div id="reviewDiv">                
                        <h4 class="txttTransformNorml addpaddingB20">Reviews<span class="rbutton"> <a class="carousel-control left" href="#reviewCarousel" data-slide="prev"><img src="<?php echo ThemePath(); ?>/images/slide-left.png" /></a><a class="carousel-control right" href="#reviewCarousel" data-slide="next"><img src="<?php echo ThemePath(); ?>/images/slide-right.png" /></a></span></h4>
                        <?php /* ---------render page reviewpage for view all  review start ---------------- */ ?>
                        <?php $this->renderPartial('/reviews/_viewReview', array('model' => $model)); ?>
                        <?php /* ---------render page reviewpage end---------------- */ ?>

                    </div>
                    <div id="reviewEntryBox" style="display:none;">
                        <h4 class="txttTransformNorml">Add Review</h4>
                        <form>
                            <fieldset>
                                <?php /* ---------render page reviewpage for write review start ---------------- */ ?>
                                <?php $this->renderPartial('/reviews/_form', array('model' => $model, 'classcoursetype' => 'classes')); ?>
                                <?php /* ---------render page reviewpage end---------------- */ ?>
                            </fieldset>
                        </form>
                    </div>
                </div>
                <!--End of Review Box-->    
            </div>
            <div class="span7">
                <!--Query Box-->  <?php if ($model->class_type_id == CURATED_CLASS_TYPE) { ?>
                    <div class="reviewBox">

                        <h4 class="txttTransformNorml">Have a query about this class ?<br>Write to Us:</h4>
                        <div class="errorMessage" id="class-course-query-form-formResult" style="margin: 90px 0px 0px 60px;font-size: 25px;color: #fff;display: none;"></div>
                       
                        <?php /* ---------render page reviewpage for write Query start ---------------- */ ?>
                        <?php $this->renderPartial('/classCourseQuery/_classQuery', array('class_course_type' => 'classes', 'classId' => $model->id)); ?>


                    </div>  <?php
                    /* ---------render page reviewpage end---------------- */
                } else {
                        ?>
                    <div class="ratingBox addmarginB20">                        
                        <h4 class="txttTransformNorml addpaddingB20">Was the information on the<br>page sufficient?</h4>
                        <div class="padding20px">
                            
                            <?php /* here 1=>like and 2=>unlike for status */ ?>
                            <p class="fnt-size14 txtfff">Class description</p>
                            <p class="addmarginB20"><a href="javascript:void(0);" class="sprite thumb-up addmarginR10" onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::DESCRIPTION_CLASS_COURSE; ?>,'class',1)"></a><a href="javascript:void(0);" class="sprite thumb-down" onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::DESCRIPTION_CLASS_COURSE; ?>,'class',2)"></a></p>
                            <p class="fnt-size14 txtfff">Class Structure</p>
                            <p class="addmarginB20"><a href="javascript:void(0);" class="sprite thumb-up addmarginR10" onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::STRUCTURE_CLASS_COURSE; ?>,'class',1)"></a><a href="javascript:void(0);" class="sprite thumb-down" onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::STRUCTURE_CLASS_COURSE; ?>,'class',2)"></a></p>
                            <p class="fnt-size14 txtfff">Class Outcome</p>
                            <p><a href="javascript:void(0);" class="sprite thumb-up addmarginR10" onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::OUTCOME_CLASS_COURSE; ?>,'class',1)"></a><a href="javascript:void(0);" class="sprite thumb-down" onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::OUTCOME_CLASS_COURSE; ?>,'class',2)"></a></p>
                       <div id="ajaxLoder_<?php echo $model->id; ?>" style="margin: 0 auto;width: 50%;display: none;"><img src="<?php echo ThemePath(); ?>/images/AjaxLoader.gif"></img></div>
                        </div>                    
                    </div><?php } ?>
                <!--End of Query Box-->
            </div>
        </div>
    </div>
</section>

<section class="contentCntr whiteBg">
    <div class="container">
        <div class="row">
            <!--Tags Section-->
            <div class="span5">
                <h4 class="font-opensanslt txt999 fnt-size26 txttTransformNorml fnt-weightN addpaddingB10">Tags</h4>
                <div class="tagElement blueBor radius4px">
                    <div class="padding20px">
                        <?php
                        /* --------------------code for write class tag------------------------------------- */
                        foreach ($classTag as $key => $value) {
                            if (!empty($value)) {
                                echo '<span class="hastag">#' . $value . '</span>';
                            }
                        }
                        ?>
                    </div>
                </div>
            </div>
            <!--End Tags Section-->
            <!--Recommend Section-->
            <div class="span7">
                <h4 class="font-opensanslt txt999 fnt-size26 txttTransformNorml addpaddingB10 fnt-weightN">Reviews and Recommendations</h4>
                <div class="recommendBox">

                    <div class="contents">
                        <div class="floatL">
                            <h4><?php echo (!empty($classtotalCountTrainerate)) ? $classtotalCountTrainerate . '<br>Recommendations' : 'No Recommendations'; ?></h4>
                            <p class="padding10px font-opensansilt fnt-size20 whiteBg inline-block noRadius"><?php echo (!empty($classTrainerRate)) ? $classTrainerRate . '% Positive' : '0% Positive'; ?></p>
                        </div>
                        <img class="floatR" src="<?php echo ThemePath(); ?>/images/recomend-hand.png" />
                    </div>

                </div>
            </div>
            <!--End Recommend Section-->
        </div>
    </div>
</section>
<?php /* Literally Ending tomorrow Slider */ ?>
<?php
$allClassCourseInfo = array();
$classDetails = literalEndingTommorow('', '', '');
$courseDetails = runningCurrentCoursesByUser('', '', ''); //Null parameter means these value $profiles, $userType, $getValue)
$allClassCourseInfo = array_merge($classDetails, $courseDetails);
usort($allClassCourseInfo, 'date_compare');
$validatedata = literalendingtommorowValiadte($allClassCourseInfo);
if (!empty($validatedata)) {
    $this->renderPartial('/classes/literallyEndingtomorrow', array('allClassCourseInfo' => $allClassCourseInfo));
}
?>

<?php /* code for slider People who liked this Literally Ending tomorrow */ ?>
<?php
$likeClassCourse = peoplelikedClassCourse();
if (!empty($likeClassCourse)) {
    $this->renderPartial('_likeClassCourse');
}
?>

<script type="text/javascript" src="<?php echo ThemePath(); ?>/js/jquery.nicescroll.js"></script>
<script type="text/javascript"> 
    function likeUnlikeClassCourseContent(classid,type,classcoursetype,status){       
        jQuery.ajax({
            'type': 'POST',
            'url': "<?php echo Yii::app()->createAbsoluteUrl("ClassCourseContentLikeUnlike/savelikeUnlikeClassCourseContent"); ?>",
            'data': "type=" + type + "&classcourseId=" + classid+"&classcoursetype="+classcoursetype+"&status="+status,
            'beforeSend': function(jqXHR, settings) {
                $("#ajaxLoder_" + classid).show();
            },
            'success': function(data) {               
                if (data==1) {    
                    $("#ajaxLoder_" + classid).hide();
                }
                
            },
            'cache': false
        });
        
    }
    
     
    
    
    /* This is for add to comare and remove */
    $(document).ready(function(){
        $(".product img").draggable({
            containment: 'document',
            opacity: 0.6,
            revert: 'invalid',
            helper: 'clone',
            zIndex: 100
        });

        $("div.drop-here").droppable({
            drop:
                function(e, ui){
                var param = $(ui.draggable).attr('id');
                if($.browser.msie && $.browser.version=='6.0'){
                    param = $(ui.draggable).attr('style').match(/src=\"([^\"]+)\"/);
                    param = param[1];
                }
                addToCompareList(param);
            }
       
        });

    });

    function addToCompareList(param){
        var compareadded=new Array();
        $.post("<?php echo Yii::app()->createUrl("compare/CompareclassAddClassById"); ?>",
        {class_course_id: param,classcoursetype: 'class'},
        function(resultclass) {
            if(resultclass!=''){
                $("#ajax-loader").hide();
                var comparedata = resultclass.split('#@#');
                var className = comparedata[0];
                var classImg = comparedata[1];
                var check=false;
                var cnt = false;
                $("#cart_comapre").append('<li id="'+param+'"><a href="javascript:void(0);" onclick="RemoveCompareList('+param+',\'class\');" class="sprite cross">&nbsp;</a>'+classImg+'<p class="product">'+className+'</p><input type="hidden" class="compareids" name="class_course_id[]" value="'+param+'" /></li>');}
        });
    }
    function RemoveCompareList(classcourseid,class_courseType){
        var classcourseid = classcourseid+"@"+class_courseType;
        $.post("<?php echo Yii::app()->createUrl("compare/RemovecompareclasscourseById"); ?>",
        {class_course_id: classcourseid,class_course_type: class_courseType},
        function(resultclass) {
            if(resultclass=="no"){
                $("#ajax-loader").hide();
                $("#comapre_div_id").hide();
            }else{
                $("#ajax-loader").hide();
                $('#cart_comapre').html(resultclass);
            }
        });
    }

    /*function removeCompare(id) {$("div #" + id).remove();}*/
    /* END */
    jQuery(document).ready(function() {  
        $("#descriptionTabs").niceScroll({touchbehavior: true, autohidemode: true});
        //function call for load venue details and batch details start//
        getVenueDetails($("#ShoppingCart_venue_id").val());
        $('.batchDetail').fancyfields({onSelectChange: function(input, text, val) {
                onstartdateChange(val);
            }});
        $('.batchSeat').fancyfields({
            onSelectChange: function(input, text, val) {
                var batchId=$("#batch_start_date").val();            
                getpricewithDiscount(batchId,val)
            } });
        //function call for load venue details end//
        $('.timeFrom').fancyfields();
        $('.timeTo').fancyfields();
        $('.batchTime').fancyfields() 
        $("#mybook").click(function(event) {
            $("#myvbatch").click();
			$('html, body').animate({scrollTop: $("#venueBatchscroll").offset().top -89},3000);
        });
       
        //get selected venue details//
        function getVenueDetails(venueIndex) { 
            $.post("<?php echo Yii::app()->createUrl("classVenue/SelectedVenue"); ?>", {venueId: venueIndex, user_id: 2},
            function(result) {
                if (result != "") {
                    $('#myloader').css('display', 'none');
                }
                $("#showVenueDataResult").html(result);
            });
        }
        //get selected batchdate from batchid details//
        function onstartdateChange(val){
            var venueId=$(".venueDetail").val();         
            $.ajax({
                type:'POST',
                url:'<?php echo Yii::app()->createUrl("ClassBatch/selectBatchdate"); ?>',
                dataType:'JSON',
                data:'batchid='+val+'&venueId='+venueId+'&classId=<?php echo $model->id; ?>',
                success:function(data) {
                    batchTimeinselectBox(data);                         
                    $('#myloader').css('display', 'none');
                }
            });  
        }   
        //on venue change show all batch information //
        $('.venueDetail').fancyfields({
            onSelectChange: function(input, text, val) {
                //function use for venue details
                getVenueDetails(val);
                $.ajax({
                    type:'POST',
                    url:'<?php echo Yii::app()->createUrl("ClassBatch/BatchDeatils"); ?>',
                    dataType:'JSON',
                    data:'venueId='+val+'&classId=<?php echo $model->id; ?>',
                    success:function(data) { 
                        var batchstart='';
                        batchTimeinselectBox(data);
                        $("#batch_start_date").remove();
                        $('#myloader').css('display', 'none');
                        $("#batchval").html('<select id="batch_start_date" name="batch_start_date" class="batchDetail"></select>');
                        $.each(data,function(i,obj) {
                            batchstart+="<option value='"+obj.id+"'>"+obj.start_date+"</option>";
                        });
                        $("#batch_start_date").html(batchstart);
                        $('.batchDetail').fancyfields({
                            onSelectChange: function(input, text, val) {
                                onstartdateChange(val)
                            } });
                    }
                });
               
            }
        }); 
        //get selected batchseats details//
        function batchSeatinselectBox(batchId,seats){
            var batchseats=''; 
            $("#batch_batchseats").remove();
            $("#batchticketval").html('<select id="batch_batchseats" name="batch_batchseats" class="batchSeat"></select>');
            for(i=1;i<=seats;i++)      {                   
                batchseats+="<option value='"+i+"'>"+i+"</option>";
            }                       
            $("#batch_batchseats").html(batchseats);   
            getpricewithDiscount(batchId,1);
            $('.batchSeat').fancyfields({
                onSelectChange: function(input, text, val) {
                    getpricewithDiscount(batchId,val)
                } });
        }
        //get selected batch time //
        function batchTimeinselectBox(data){
            var batchstarttime='';
            $("#batch_starttime").remove();
            $("#batchtimeval").html('<select id="batch_starttime" name="batch_starttime" class="batchTime"></select>');
            $.each(data,function(i,obj) { 
                if(i==0){ batchSeatinselectBox(obj.id,obj.seats); }
                batchstarttime+="<option value='"+obj.id+"'>"+obj.start_time+"</option>";
            });
            $("#batch_starttime").html(batchstarttime); 
            $('.batchTime').fancyfields()
        }
        //get get price with discount and early discount//
        function getpricewithDiscount(batchId,seats){
            $.ajax({
                type:'POST',
                url:'<?php echo Yii::app()->createUrl("ClassBatch/batchDiscount"); ?>',              
                data:'batchId='+batchId+'&seats='+seats,
                success:function(data) {
                    $(".totalBatchseatsPrice").html('');
                    $(".totalBatchseatsPrice").html(data);
                }});
        }  
        
        $(".comareclass").fancyfields({
            onCheckboxChange: function (input, isChecked, val) {			
                $("#copareloader").show();
                /*alert("ID : " + input.attr("id") + " Is checked : " + isChecked);*/
                if(isChecked==true){
                    $.post("<?php echo Yii::app()->createUrl("compare/CompareclassAddClassById"); ?>", {classcoursetype: 'class', class_course_id: input.attr("id")}, function(resultclass) {   $("#comapre_div_id").show();
                        var comparedata = resultclass.split('#@#');
                        var className = comparedata[0];
                        var classImg = comparedata[1];
                        var countcomare = comparedata[2];
                        if(countcomare>1){
                            $("#cart_comapre").append('<li id="'+input.attr("id")+'"><a href="javascript:void(0);" onclick="RemoveCompareList('+input.attr("id")+',\'class\');" class="sprite cross">&nbsp;</a>'+classImg+'<p class="product">'+className+'</p><input type="hidden" class="compareids" name="class_course_id[]" value="'+input.attr("id")+'@class" /></li>');$("#copareloader").hide();
                        }else{
                            $("#cart_comapre").html('<li id="'+input.attr("id")+'"><a href="javascript:void(0);" onclick="RemoveCompareList('+input.attr("id")+',\'class\');" class="sprite cross">&nbsp;</a>'+classImg+'<p class="product">'+className+'</p><input type="hidden" class="compareids" name="class_course_id[]" value="'+input.attr("id")+'@class" /></li>');$("#copareloader").hide();
                        }                                                                                          
                    });                                                                        
                }else{                                                                        
                    RemoveCompareList(input.attr("id"),"class");                             
                }                                                                          
            }
        });                                                                   
        $(".customSBDemo").fancyfields({customScrollBar: false});
    });
 
    
    function BookNow(VenueId, BatchId) {
        $('#myloader').show(0).delay(5000).hide(0);
        $("#getvanuename").setVal(VenueId);
        $("#getbatchdate").setVal(BatchId);
    }
  
    function NotBeforeToday(date) {
        var now = new Date(); //this gets the current date and time
        if (date.getFullYear() == now.getFullYear() && date.getMonth() == now.getMonth() && date.getDate() > now.getDate())
            return [true];
        if (date.getFullYear() >= now.getFullYear() && date.getMonth() > now.getMonth())
            return [true];
        if (date.getFullYear() > now.getFullYear())
            return [true];
        return [false];
    }
    $("#writeRbtn").click(function() {
        $("#reviewDiv").hide();
        $("#reviewEntryBox").show();
        return false;
    });
    $("#cancelRbtn").click(function() {
        $("#reviewEntryBox").hide();
        $("#reviewDiv").show();
        return false;
    });
    $("#addNewReview").click(function() {
        $("#reviewDiv").hide();
        $("#reviewEntryBox").show();
        return false;
    });
</script>
